#ifndef NETWORKCOMMUNICATOR_H
#define NETWORKCOMMUNICATOR_H
#include <QNetworkReply>
#include <QNetworkRequest>
#include <QNetworkAccessManager>
#include <QNetworkSession>
#include "VideoInfo.h"
#include "pugixml.hpp"
#include "playlist.h"

class NetworkCommunicator : public QObject
{
    Q_OBJECT
    public:
        explicit NetworkCommunicator(QObject *parent = 0);

    signals:
        void newSearchDone(Playlist);
        void newStreamUrlFound(QUrl);

    public slots:
        void search(QString);
        void findStreamUrl(VideoInfo);


    private slots:
        void videoSearchCompleted();
        void gotVideoInfo();

    private:
        VideoInfo currentvid;
        QNetworkAccessManager mgr;
        QNetworkSession* session;

    
};

#endif // NETWORKCOMMUNICATOR_H
